<template>
  <div class="guide">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(l, i) in imgs" :key="i">
        <img :src="l" class="g-img" alt="" />
      </van-swipe-item>
    </van-swipe>
    <p class="countdown" @click="gotoPage('main')">
      跳过广告<van-count-down
        class="time"
        :time="time * 1000"
        format="ss"
        @finish="timeFinish"
      />S
    </p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      imgs: [
        require("@/assets/images/img1.jpg"),
        require("@/assets/images/img2.jpg"),
        require("@/assets/images/img3.jpg"),
        require("@/assets/images/img4.jpg"),
      ],
      time: 8,
    };
  },
  methods: {
    timeFinish() {
      this.gotoPage("main");
    },
  },
};
</script>


<style lang="scss" scoped>
.guide {
  width: 100%;
  height: 100%;
  position: relative;
  .my-swipe {
    width: 100%;
    height: 100%;
  }
  .g-img {
    width: 100%;
    height: 100%;
  }
  p {
    width: 130px;
    height: 35px;
    text-align: center;
    border-radius: 15px;
    background-color: gray;
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 14px;
    color: #fff;
    line-height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .time {
    font-size: 14px;
    color: #000;
  }
}
</style>